\(\int \sqrt {\csc ^2(x)} \, dx\) [42]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 8, antiderivative size = 5 \[ \int \sqrt {\csc ^2(x)} \, dx=-\text {arcsinh}(\cot (x)) \]

[Out]

-arcsinh(cot(x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 5, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4207, 221} \[ \int \sqrt {\csc ^2(x)} \, dx=-\text {arcsinh}(\cot (x)) \]

[In]

Int[Sqrt[Csc[x]^2],x]

[Out]

-ArcSinh[Cot[x]]

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 4207

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[b*(ff/
f), Subst[Int[(b + b*ff^2*x^2)^(p - 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p
]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{\sqrt {1+x^2}} \, dx,x,\cot (x)\right ) \\ & = -\text {arcsinh}(\cot (x)) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(28\) vs. \(2(5)=10\).

Time = 0.01 (sec) , antiderivative size = 28, normalized size of antiderivative = 5.60 \[ \int \sqrt {\csc ^2(x)} \, dx=\sqrt {\csc ^2(x)} \left (-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \sin (x) \]

[In]

Integrate[Sqrt[Csc[x]^2],x]

[Out]

Sqrt[Csc[x]^2]*(-Log[Cos[x/2]] + Log[Sin[x/2]])*Sin[x]

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.51 (sec) , antiderivative size = 17, normalized size of antiderivative = 3.40

method result size
default \(\frac {\operatorname {csgn}\left (\csc \left (x \right )\right ) \ln \left (\csc \left (x \right )-\cot \left (x \right )\right ) \sqrt {4}}{2}\) \(17\)
risch \(2 \sqrt {-\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-1\right ) \sin \left (x \right )-2 \sqrt {-\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+1\right ) \sin \left (x \right )\) \(62\)

[In]

int((csc(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*csgn(csc(x))*ln(csc(x)-cot(x))*4^(1/2)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 19 vs. \(2 (5) = 10\).

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 3.80 \[ \int \sqrt {\csc ^2(x)} \, dx=-\frac {1}{2} \, \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \frac {1}{2} \, \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \]

[In]

integrate((csc(x)^2)^(1/2),x, algorithm="fricas")

[Out]

-1/2*log(1/2*cos(x) + 1/2) + 1/2*log(-1/2*cos(x) + 1/2)

Sympy [F]

\[ \int \sqrt {\csc ^2(x)} \, dx=\int \sqrt {\csc ^{2}{\left (x \right )}}\, dx \]

[In]

integrate((csc(x)**2)**(1/2),x)

[Out]

Integral(sqrt(csc(x)**2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 35 vs. \(2 (5) = 10\).

Time = 0.31 (sec) , antiderivative size = 35, normalized size of antiderivative = 7.00 \[ \int \sqrt {\csc ^2(x)} \, dx=-\frac {1}{2} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + \frac {1}{2} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) \]

[In]

integrate((csc(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/2*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 1/2*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 12 vs. \(2 (5) = 10\).

Time = 0.27 (sec) , antiderivative size = 12, normalized size of antiderivative = 2.40 \[ \int \sqrt {\csc ^2(x)} \, dx=\frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{\mathrm {sgn}\left (\sin \left (x\right )\right )} \]

[In]

integrate((csc(x)^2)^(1/2),x, algorithm="giac")

[Out]

log(abs(tan(1/2*x)))/sgn(sin(x))

Mupad [F(-1)]

Timed out. \[ \int \sqrt {\csc ^2(x)} \, dx=\int \sqrt {\frac {1}{{\sin \left (x\right )}^2}} \,d x \]

[In]

int((1/sin(x)^2)^(1/2),x)

[Out]

int((1/sin(x)^2)^(1/2), x)